{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(960, 540)\n",
      "end\n"
     ]
    }
   ],
   "source": [
    "import cv2\n",
    "img = cv2.imread('image1.jpg')\n",
    "imgInfo = img.shape\n",
    "size = (imgInfo[0],imgInfo[1])\n",
    "print(size)\n",
    "# 参数1;合成后的视频文件 参数2：编码器选择（-1代表选择可用的） 参数3：合成后的视频帧率 参数4：图片大小\n",
    "videoWrite = cv2.VideoWriter('2.mp4',-1,15,size)\n",
    "for i in range(1,11):\n",
    "    fileName = 'image'+str(i)+'.jpg'\n",
    "    img = cv2.imread(fileName)\n",
    "    videoWrite.write(img)\n",
    "print('end')    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
